package org.iwidget.desktop.core.javascript;

/**
 *
 * @author Muhammad Hakim A
 */
import java.awt.Dimension;
import java.awt.Toolkit;
import org.mozilla.javascript.ScriptableObject;

public class IwidgetScreen extends ScriptableObject
{

    public String getClassName()
    {
        return "screen";
    }

    public IwidgetScreen()
    {
    }

    public void jsConstructor()
    {
    }

    public void jsSet_width(int i)
    {
    }

    public int jsGet_width()
    {
        return getWidth();
    }

    public int jsFunction_getWidth()
    {
        return getWidth();
    }

    public int getWidth()
    {
        Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
        return screen.width;
    }

    public void jsSet_height(int i)
    {
    }

    public int jsGet_height()
    {
        return getHeight();
    }

    public int jsFunction_getHeight()
    {
        return getHeight();
    }

    public static int getHeight()
    {
        Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
        return screen.height;
    }

    private static final long serialVersionUID = 0x2d32313336383339L;
}